package com.zw.a.basic.a15.pojo;

//自定义的JavaBean类, 表示学生类
public class Student {
    //成员变量
    private String name;
    private int age;
    public String phone;

    //构造方法
    public Student() {
    }

    private Student(String name) {
        this.name = name;
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", phone='" + phone + '\'' +
                '}';
    }

    //成员方法
    public void show1() {
        System.out.println("show1 方法");
    }

    private void show2() {
        System.out.println("show2 方法");
    }

    private int getSum(int a, int b) {
        return a + b;
    }


    public void eat() {
        System.out.println("Student eat()");
    }

    public void study() {
        System.out.println("学生要学习!");
    }
}
